package backstage.product;

import java.util.HashMap;

public class memberInfo {
    
    private int id;
    private shops.member member;  
    
    public memberInfo() {
    }
    
    public String execute() throws Exception {
     
        NWDB.NWDB mydb=new NWDB.NWDB();
        NWDB.IMember im=new NWDB.ImplMember(mydb.getConnection());
        mydb.setIMember(im);
                      
        HashMap<String,Object> hm = mydb.GetAllMemberStatus(getId());
        this.setMember(new shops.member());
        this.getMember().setId(getId());
        this.getMember().setAccount(hm.get("Account").toString());
        this.getMember().setPassword(hm.get("Password").toString());
        this.getMember().setName(hm.get("Name").toString());
        this.getMember().setSex((Boolean)hm.get("Sex"));
        this.getMember().setBirth(hm.get("Birth").toString());
        this.getMember().setAddress(hm.get("Address").toString());
        this.getMember().setPhone(hm.get("Phone").toString());
        this.getMember().setMail(hm.get("Mail").toString());
              
        mydb.close();        
        return "success";       
    }

    /**
     * @return the id
     */
    public int getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * @return the member
     */
    public shops.member getMember() {
        return member;
    }

    /**
     * @param member the member to set
     */
    public void setMember(shops.member member) {
        this.member = member;
    }
    
    
    
}
